package spike.pool.impl;

import spike.pool.ConnectionPool;
import spike.pool.ConnectionSource;
import spike.pool.PoolFactory;

import java.util.concurrent.TimeUnit;

public class PoolFactoryImpl<T> implements PoolFactory<T> {
    @Override
    public ConnectionPool<T> newConnectionPool(int capacity, ConnectionSource<T> src) {
        return new ConnectionPoolService<T>(capacity, src);
    }

    @Override
    public ConnectionPool<T> newConnectionPool(int min, int max, long keepAliveTime, TimeUnit unit, ConnectionSource<T> src) {
        return new ConnectionPoolService<T>(min, max, keepAliveTime, unit, src);
    }
}
